/*
 * Copyright (C) 2016 The Android Open Source Project
 *  Created by  Ant  2016/7/21  17:23
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package test.ant.com.myframe.base;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.text.TextUtils;
import android.widget.Toast;

/**
 * Created by baichuan on 2016/7/21.
 */
public abstract class AntBaseActivity extends FragmentActivity implements AntBaseInterface {
    public String TAG = "";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(getContextView());//
        TAG = this.getClass().getSimpleName();
        initView();
        initData();
        initListener();
    }


    /**
     * 跳转到指定的Activity
     *
     * @param toActivity
     */
    public void ToActivity(Class toActivity) {
        Intent in = new Intent(this, toActivity);
        this.startActivity(in);
    }

    public void AntToast(String mess) {
        if (TextUtils.isEmpty(mess))
            return;
        Toast.makeText(this, mess, Toast.LENGTH_SHORT).show();
    }

}
